/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package aiaudio.processing.network;

import aiaudio.processing.network.manager.DBAudioNetworkManager;
import aiaudio.lastfm.hbase.CannotCreateTableException;
import aiaudio.processing.MainTableGroup;
import aiaudio.processing.base.AlgorithmParameters;
import aiaudio.processing.base.TimeMeasuredAlgorithm;
import aiaudio.processing.network.groupping.GroupTransponationAlgorithm;
import java.io.IOException;

/**
 *
 * @author nastya
 */
public class NetworkCalculationAlgorithm extends TimeMeasuredAlgorithm<NetworkCalculationAlgorithmParameters> {

    public NetworkCalculationAlgorithm(MainTableGroup mainTableGroup) {
        super(mainTableGroup, "network calculation");
    }

    @Override
    protected void removeTemporaryTables() {
    }

    @Override
    protected void createTemporaryTables() throws IOException {
    }

    @Override
    protected void process() throws IOException, CannotCreateTableException, InterruptedException, ClassNotFoundException {
        DBAudioNetworkManager manager = new DBAudioNetworkManager(mainTableGroup);
        manager.setDivisor(parameters.getDivisor());
        manager.setLearningCicles(parameters.getLearningCicles());
        manager.setMinSimilarity(parameters.getMinSimilarity());
        manager.setTrainingSetSize(parameters.getTrainingSetSize());
        manager.start();
        
        GroupTransponationAlgorithm alg = new GroupTransponationAlgorithm(mainTableGroup);
        alg.start();
    }

    @Override
    protected void measureAll() throws IOException {
    }

    @Override
    protected void writeParameters(NetworkCalculationAlgorithmParameters parameters) throws IOException {
    }
    
}
